From 11396cb71fead96005e002d60c7065bc944bafce Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 17 Aug 2004 19:51:11 +0000 Subject: [PATCH] Look up icon themes in the directories specified in the icon theme spec: 2004-08-17 Matthias Clasen * gtk/gtkicontheme.c (gtk_icon_theme_init): Look up icon themes in the directories specified in the icon theme spec: $HOME/.icons, $XDG_DATA_DIRS/icons, /usr/share/pixmaps. Note that GTK+ used to also look in $GTK_DATA_DIR/icons, $GTK_DATA_DIR/pixmaps and /usr/share/icons. (#148694) --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkicontheme.c | 27 +++++++++++++++++---------- 5 files changed, 41 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index fb47b318cd..b3724e68da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2004-08-17 Matthias Clasen + * gtk/gtkicontheme.c (gtk_icon_theme_init): Look up icon themes in the + directories specified in the icon theme spec: $HOME/.icons, + $XDG_DATA_DIRS/icons, /usr/share/pixmaps. Note that GTK+ used to also look + in $GTK_DATA_DIR/icons, $GTK_DATA_DIR/pixmaps and /usr/share/icons. (#148694) + + * gtk/gtkframe.c (gtk_frame_paint): Take widget->state into account when painting the shadows. (#150351, Tim Janik) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index fb47b318cd..b3724e68da 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,11 @@ 2004-08-17 Matthias Clasen + * gtk/gtkicontheme.c (gtk_icon_theme_init): Look up icon themes in the + directories specified in the icon theme spec: $HOME/.icons, + $XDG_DATA_DIRS/icons, /usr/share/pixmaps. Note that GTK+ used to also look + in $GTK_DATA_DIR/icons, $GTK_DATA_DIR/pixmaps and /usr/share/icons. (#148694) + + * gtk/gtkframe.c (gtk_frame_paint): Take widget->state into account when painting the shadows. (#150351, Tim Janik) diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index fb47b318cd..b3724e68da 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,11 @@ 2004-08-17 Matthias Clasen + * gtk/gtkicontheme.c (gtk_icon_theme_init): Look up icon themes in the + directories specified in the icon theme spec: $HOME/.icons, + $XDG_DATA_DIRS/icons, /usr/share/pixmaps. Note that GTK+ used to also look + in $GTK_DATA_DIR/icons, $GTK_DATA_DIR/pixmaps and /usr/share/icons. (#148694) + + * gtk/gtkframe.c (gtk_frame_paint): Take widget->state into account when painting the shadows. (#150351, Tim Janik) diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index fb47b318cd..b3724e68da 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,11 @@ 2004-08-17 Matthias Clasen + * gtk/gtkicontheme.c (gtk_icon_theme_init): Look up icon themes in the + directories specified in the icon theme spec: $HOME/.icons, + $XDG_DATA_DIRS/icons, /usr/share/pixmaps. Note that GTK+ used to also look + in $GTK_DATA_DIR/icons, $GTK_DATA_DIR/pixmaps and /usr/share/icons. (#148694) + + * gtk/gtkframe.c (gtk_frame_paint): Take widget->state into account when painting the shadows. (#150351, Tim Janik) diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index b8db2b6402..edc6ca64be 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -524,24 +524,31 @@ static void gtk_icon_theme_init (GtkIconTheme *icon_theme) { GtkIconThemePrivate *priv; - + gchar **xdg_data_dirs; + int i, j; + priv = g_type_instance_get_private ((GTypeInstance *)icon_theme, GTK_TYPE_ICON_THEME); icon_theme->priv = priv; priv->custom_theme = FALSE; priv->current_theme = g_strdup (DEFAULT_THEME_NAME); - priv->search_path = g_new (char *, 5); + + xdg_data_dirs = g_get_system_data_dirs (); + for (i = 0; xdg_data_dirs[i]; i++) ; + + priv->search_path_len = i + 3; + + priv->search_path = g_new (char *, priv->search_path_len); + + i = 0; + priv->search_path[i++] = g_build_filename (g_get_home_dir (), ".icons", NULL); + priv->search_path[i++] = g_build_filename (g_get_user_data_dir (), "icons", NULL); + for (j = 0; xdg_data_dirs[j]; j++) + priv->search_path[i++] = g_build_filename (xdg_data_dirs[j], "icons", NULL); - priv->search_path[0] = g_build_filename (g_get_home_dir (), - ".icons", - NULL); - priv->search_path[1] = g_build_filename (GTK_DATADIR, "pixmaps", NULL); - priv->search_path[2] = g_build_filename (GTK_DATADIR, "icons", NULL); - priv->search_path[3] = g_strdup ("/usr/share/icons"); - priv->search_path[4] = g_strdup ("/usr/share/pixmaps"); - priv->search_path_len = 5; + priv->search_path[i++] = g_strdup ("/usr/share/pixmaps"); priv->themes_valid = FALSE; priv->themes = NULL; -- 2.30.2